﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ATM
{
    public partial class takecash : Form
    {
        AtmModel atm = new AtmModel();
        Balance atm_balance = new Balance();
        takebalance take = new takebalance();
        public takecash()
        {
            InitializeComponent();
        }

        private void button5_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (true == atm.takeCash(50))
            {
                take.ShowDialog();
                this.Close();
            }
            else
            {
                MessageBox.Show("Not enough money on your account!");
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            if (true == atm.takeCash(100))
            {

                take.ShowDialog();
                this.Close();
            }
            else
            {
                MessageBox.Show("Not enough money on your account!");
            }
        }

        private void button3_Click(object sender, EventArgs e)
        {
            if (true == atm.takeCash(200))
            {

                take.ShowDialog();
                this.Close();
            }
            else
            {
                MessageBox.Show("Not enough money on your account!");
            }
        }

        private void button4_Click(object sender, EventArgs e)
        {
            if (true == atm.takeCash(Convert.ToInt32(textBox1.Text)))
            {
                take.ShowDialog();
                this.Close();
            }
            else
            {
                MessageBox.Show("Not enough money on your account!");
            }
        }
    }
}
